package md.frolov.bible;

import md.frolov.bible.views.BooksView;
import md.frolov.bible.views.CommentariesView;
import md.frolov.bible.views.DictionaryView;
import md.frolov.bible.views.HistoryView;
import md.frolov.bible.views.ModulesView;
import md.frolov.bible.views.ReferenceView;
import md.frolov.bible.views.SearchView;
import md.frolov.bible.views.StrongView;

import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
import org.eclipse.ui.IWorkbenchPreferenceConstants;
import org.eclipse.ui.PlatformUI;

public class Perspective implements IPerspectiveFactory {
	private final String bottomId = "folder.bottom";
	private final String rightId = "folder.right";
	private final String leftId = "folder.left";

	public void createInitialLayout(IPageLayout layout) {		
		String editorArea = layout.getEditorArea();
		layout.setEditorAreaVisible(true);
		
		layout.addView(ModulesView.PLUGIN_ID, IPageLayout.LEFT, 0.2f, editorArea);
		
		IFolderLayout leftFolder = layout.createFolder(leftId, IPageLayout.BOTTOM, 0.3f, ModulesView.PLUGIN_ID);
		leftFolder.addView(BooksView.PLUGIN_ID);
		leftFolder.addView(HistoryView.PLUGIN_ID);
		
		IFolderLayout bottomFolder = layout.createFolder(bottomId, IPageLayout.BOTTOM, 0.7f,editorArea);
		bottomFolder.addView(CommentariesView.PLUGIN_ID);
		bottomFolder.addView(DictionaryView.PLUGIN_ID);
		
		IFolderLayout rightFolder = layout.createFolder(rightId, IPageLayout.RIGHT, 0.7f,editorArea);
		rightFolder.addView(ReferenceView.PLUGIN_ID);
		rightFolder.addView(SearchView.ID);
		rightFolder.addView(StrongView.PLUGIN_ID);

		PlatformUI.getPreferenceStore().setValue(IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS, false);
	}
	
}